/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!				\file		CC_Item.h
				\date		june 2010
				\author		TNick

				\brief		Contains the definition of CC_Item class and related


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please read ReadMe.txt and Licence.txt in root folder
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef		__CC_ITEM_INC__
#define		__CC_ITEM_INC__
#ifdef		__cplusplus
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

class	CC_Err;

#include	"CC_Err.h"
#include	"../generic/cc_l2d.h"
#include	<base/uni_prp/PrpAgreg.h>
#include	<base/uni_prp/PrpHost.h>

/*  INCLUDES    ============================================================ */
//
//
//
//


/// Class representing an item (both graphical and non-graphical
/**
*
*/
class	CC_Item	: public CC_L2D, public PrpHost {


	//
	//
	//
	//
	/*  DEFINITIONS    --------------------------------------------------------- */

	
	/*  DEFINITIONS    ========================================================= */
	//
	//
	//
	//
	/*  DATA    ---------------------------------------------------------------- */



	/*  DATA    ================================================================ */
	//
	//
	//
	//
	/*  FUNCTIONS    ----------------------------------------------------------- */
public:
	/// constructor
	CC_Item();

	/// destructor; will free resources;
	virtual				~CC_Item();

	/// tell if this item is a graphical one or not
	virtual bool		IsGraphical();




	/* >>>>>>>>>>>>>>>>>>>>>>>>>>>   PrpHost   <<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
	/// get the list of properties a a list of pointers to PrpAgreg instances
	/**
	*	@return		array allocated using new[]; the ownership of the array
		 passes to caller; may be NULL for memory failures or if the item
		 has no properties
	*/
	virtual PrpAgreg**	propList		(
			int*		p_count	/**< pointer to variable that recives
		the number of elements in the list */
			) { *p_count = 0; return NULL; }


	/// informs the item about a chnge in properties
	/**
	*	the item must determine inside if it supports this property and,
	*	if it does, shall update it's value. If the item does not support
	*	this feature, it should silently ignore this call.
	*/
	virtual void		propChanged		(
			PrpAgreg*	p_new_val	/**< pointer to changed value */
			) { Q_UNUSED(p_new_val); }



	/* >>>>>>>>>>>>>>>>>>>>>>>>>>>  FILE I/O   <<<<<<<<<<<<<<<<<<<<<<<<<<<<< */
	/// saves the data regarding this class to a stream in CASP_1 format
	/*
	*	@return		true all went OK; false some went wrong
	*/
	virtual CCERR::EERRORS		Save_CASP_1	(QDataStream* pStream, CC_Err* pErr) = 0;

	/// loads the data regarding this class from a stream in CASP_1 format
	/*
	*	@return		true all went OK; false some went wrong
	*/
	virtual CCERR::EERRORS		Load_CASP_1	(QDataStream* pStream, CC_Err* pErr) = 0;


	/// saves the data regarding this class to a stream in DXF format
	/*
	*	@return		true all went OK; false some went wrong
	*/
	virtual CCERR::EERRORS		Save_DXF	(QDataStream* pStream, CC_Err* pErr) = 0;

	/// loads the data regarding this class from a stream in DXF format
	/*
	*	@return		true all went OK; false some went wrong
	*/
	virtual  CCERR::EERRORS		Load_DXF	(QDataStream* pStream, CC_Err* pErr) = 0;




	/*  FUNCTIONS    =========================================================== */
	//
	//
	//
	//

};	/*	class	CC_Item	*/
//
//
//
//
#endif	//	__cplusplus
#endif	//	__CC_ITEM_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
